Skip to content

Added agent_id tracking in agent reporter collection#182

Closed
AgrimGupta04 wants to merge 13 commits intomesa:mainfrom
AgrimGupta04:main
Closed

Added agent_id tracking in agent reporter collection#182
AgrimGupta04 wants to merge 13 commits intomesa:mainfrom
AgrimGupta04:main

Conversation

@AgrimGupta04
Copy link

This PR enhances the agent data collection process by ensuring that each agent reporter includes a unique identifier, the agent_id in the collected data.
Also, agent_reporters previously collected only the values of the requested columns (eg- wealth) but now includes the unique agent_id making debugging and analysis easier.
This PR solving the issue #177

@adamamer20
Copy link
Member

Hi Agrim, thanks for the PR!
A couple of notes:

  1. Please remove the unused result import from unittest, since it is not referenced anywhere.

  2. Several hasattr(...) checks, such as hasattr(agent_set, "df"), add unnecessary defensive code and reduce readability. Switch to direct attribute access and rely on the object contract instead.

Before pushing the next commit, run the test suite locally with pytest and resolve any failures. As a hint, the current failure seems related to the shape of the DataFrame.

@EwoutH EwoutH requested a review from Ben-geo November 2, 2025 12:23
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 95.45455% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.62%. Comparing base (658be7a) to head (7380395).
⚠️ Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
mesa_frames/concrete/datacollector.py 95.45% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
+ Coverage   92.54%   92.62%   +0.07%     
==========================================
  Files          14       14              
  Lines        1717     1748      +31     
==========================================
+ Hits         1589     1619      +30     
- Misses        128      129       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@AgrimGupta04
Copy link
Author

AgrimGupta04 commented Jan 26, 2026

hey @Ben-geo & @adamamer20 its been a while since the PR is raised and further review is required from your side, kindly give it a review whenever possible.
Looking forward for further contribution!

@Ben-geo
Copy link
Collaborator

Ben-geo commented Jan 27, 2026

hey @Ben-geo & @adamamer20 its been a while since the PR is raised and further review is required from your side, kindly give it a review whenever possible. Looking forward for further contribution!

Hey @AgrimGupta04
Firstly, the PR currently has merge conflicts with main. Could you please resolve those first?

While reviewing the changes, I noticed a significant number of modifications to the test cases that don’t seem necessary for the feature being added. I was also a bit confused by the overall scope of the PR. For adding a unique_id to the data collector, the implementation should ideally be much simpler. The expected behavior is just to include a unique_id column during collection when the user hasn’t explicitly provided one.

Because of this confusion, I paused the review earlier and requested a few minor changes. Unfortunately, those requested changes haven’t been implemented yet. Sorry for any confusion on my part as well.

Also, please note that we are currently in the middle of a release, so this PR may not be merged until the release is completed.

Could you please simplify the implementation accordingly and resolve the merge conflicts with main?

@AgrimGupta04 AgrimGupta04 closed this by deleting the head repository Jan 27, 2026
@AgrimGupta04
Copy link
Author

okay @Ben-geo since this PR is raised from main branch I will first go ahead and raise a new PR from a featured branch & also make sure to add the required changes to the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants